#include<linux/module.h>
#include<linux/sched.h>
#include<linux/pid.h>
MODULE_LICENSE("GPL");
static int __init pid_task_init(void)
{
	printk("into pid_task_init.\n");
	struct pid *kpid=find_get_pid(current->pid);
	struct task_struct *task=pid_task(kpid,PIDTYPE_PID);
	printk("the state of the task is:%d\n",task->state);
	printk("the pid of the task is:%d\n",task->pid);
	printk("the tgid of the task is:%d\n",task->tgid);

	printk("the pid of current thread is:%d\n",current->pid);
	printk("out pid_task_init.\n");
	return 0;
}
static void __exit pid_task_exit(void)
{
	printk("Goodbye pid_task\n");
}
module_init(pid_task_init);
module_exit(pid_task_exit);
